home *** CD-ROM | disk | FTP | other *** search
- // AbSuper.prg
- //
- // Specification and implementation of array browsing
- // class using SuperClass
-
- #include "SuperCls.ch"
-
- CLASS arrayBrowse INHERIT FROM ScTBrowse
-
- EXPORTED
- VAR arrayIndex
- VAR arrayReference
-
- MESSAGE Init
-
- END CLASS
-
-
- METHOD Init()
-
- ::InitNew()
- ::arrayIndex := 1
- ::goTopBlock := {|| ::arrayIndex := 1 }
- ::goBottomBlock := {|| ::arrayIndex := Len(::arrayReference) }
-
- // Standard array skipper
- ::skipBlock := {|nToSkip, nTemp| ;
- nTemp := ::arrayIndex, ;
- ::arrayIndex := ;
- iif(nToSkip > 0, ;
- Min(::arrayIndex + nToSkip, ;
- Len(::arrayReference)), ;
- Max(1, ::arrayIndex + nToSkip)), ;
- ::arrayIndex - nTemp ;
- }
-
- RETURN Self